feat: symbiotic setup and slash tests#1507
Open
rackstar wants to merge 7 commits intorelease-candidatefrom
Open
feat: symbiotic setup and slash tests#1507rackstar wants to merge 7 commits intorelease-candidatefrom
rackstar wants to merge 7 commits intorelease-candidatefrom
Conversation
7702ca4 to
12d256a
Compare
12d256a to
2186a02
Compare
ea7848a to
d937277
Compare
2186a02 to
8c00c3a
Compare
Base automatically changed from
feat/add-data-deadline-to-ri-cover-signature
to
release-candidate
February 17, 2026 11:30
b582e1f to
8046746
Compare
shark0der
previously approved these changes
Feb 20, 2026
8046746 to
ee83c50
Compare
📝 WalkthroughWalkthroughAdds three comprehensive test files for Symbiotic protocol integration. Includes setup orchestration for multi-vault deployments, registrations, staking, and subnetwork allocations; a Safe multisend workflow test; and extensive slashing scenario tests with state validation and token flow verification. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/fork/symbiotic/symbiotic-setup-safe-tx.js`:
- Around line 75-77: The test currently asserts safeReceipt.status equals BigInt
by comparing to 1n; update the assertion to compare the numeric
TransactionReceipt.status to 1 (not 1n). Locate the code using
executeSafeTransaction, safeTx, and safeReceipt and change the expectation to
expect(safeReceipt.status).to.equal(1) so it matches ethers v6's number-typed
receipt.status.
In `@test/fork/symbiotic/symbiotic-setup.js`:
- Around line 579-582: The opt-in assertions use undefined properties
this.vault1Addr..vault4Addr; update each call to use the deployed vault target
stored on the vault objects (e.g. replace this.vault1Addr with
this.vault1.vault.target) so that
operatorVaultOptIn.isOptedIn(this.operator1.address, <vault>.vault.target) is
asserted for vault1..vault4.
In `@test/fork/symbiotic/symbiotic-tests.js`:
- Around line 1242-1263: The test relies on state mutated by a previous test
(operatorNetworkReceiver) so make the receiver override part of this test’s
setup: after setting middleware
(this.middlewareService.connect(...).setMiddleware(...)) and before calling
this.burnerRouter.triggerTransfer(this.newMiddleware.address), explicitly set
the operator/ network receiver to this.newMiddleware (the same override that
previous tests set, i.e. ensure
SAFE_MULTISIG_SLASH_RECEIVER/operatorNetworkReceiver is updated for this.network
and this.operator1) so the triggered transfer actually routes slashed funds to
this.newMiddleware; update the test to perform that receiver override as part of
its setup and then proceed with slash and triggerTransfer.
- Around line 1212-1239: The delegated-stake assertion assumes a 1:1 reduction
but delegated stake is bounded by min(activeStake, subnetworkLimit); replace the
calculation for expectedAfterDelegatedStake so it uses
Math.min(beforeVaultStake, subnetworkLimit) minus amountToSlash (obtain
subnetworkLimit from the test fixture object for subnetwork1), then compare that
to afterDelegatedStake; apply the same adjustment to the analogous assertion
block further down.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 66442732-438d-4932-9f51-05dbfa112da8
📒 Files selected for processing (3)
test/fork/symbiotic/symbiotic-setup-safe-tx.jstest/fork/symbiotic/symbiotic-setup.jstest/fork/symbiotic/symbiotic-tests.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Context Info
Symbiotic slashing context for this PR
captureTimestampin our flow is the cover buy start timestamp — i.e. the momentbuyCoverhappens.Withdrawal lifecycle
What is slashable
If
captureEpoch == currentEpochactiveStake + withdrawals[currentEpoch + 1]withdrawals[currentEpoch]If
captureEpoch == currentEpoch - 1activeStake + withdrawals[currentEpoch] + nextWithdrawalsWhat the fork tests are validating
captureTimestampactive + nextWithdrawalsactive + currentWithdrawals + nextWithdrawalsLinks
Vault.onSlash()code: https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/contracts/vault/Vault.sol#L229Testing
Explain how you tested your changes to ensure they work as expected.
Checklist
Summary by CodeRabbit
Release Notes